package com.sunflower.common.mybatis.metadata;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.sunflower.common.mybatis.conditions.OrderSqlSegment;

/**
 * @author: SunLuQuan
 * @Date: 2024年08月02日 21:48
 * @Description: CustomOrderItem
 * TODO
 */
public class CustomOrderItem extends OrderItem {
    public CustomOrderItem(String column, boolean asc, OrderSqlSegment orderSqlSegment) {
        this.orderSqlSegment = orderSqlSegment;
        super.setColumn(column);
        super.setAsc(asc);
    }
    public CustomOrderItem(String column, OrderSqlSegment orderSqlSegment) {
        this.orderSqlSegment = orderSqlSegment;
        super.setColumn(column);
    }
    public OrderSqlSegment orderSqlSegment;

    public void setOrderSqlSegment(final String supplementary) {
        this.orderSqlSegment = () -> supplementary;
    }

    public void setOrderSqlSegment(final OrderSqlSegment orderSqlSegment) {
        this.orderSqlSegment = orderSqlSegment;
    }

    public OrderSqlSegment getOrderSqlSegment() {
        return orderSqlSegment;
    }
}
